counting number of spaces in a string in c